home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
LDB171.ARJ
/
FMUTUAL.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-12
|
2KB
|
126 lines
/*
fmutual.cpp -- Loose Data Binder v 1.7:
mutually owned and persistence
"form."
(C) Copyright 1992 John W. Small
All rights reserved
PSW / Power SoftWare
P.O. Box 10072
McLean, Virginia 22102 8072 USA
(703) 759-3838
Clone this file to speed the development of
classes derived from a Mutual hierarchy.
replace: with something like:
CLASS Mint
CPTR MinT
BASE Mutual
*/
#ifndef CLASS_HPP
#include "CLASS.hpp"
#endif
int CLASS::initData(/* CLASS-declared data
member initializers */)
{
// initialize any CLASS-declared data
// members here
return 1; // success
}
void CLASS::fput(ostream& os)
{
BASE::fput(os);
// os << CLASS-declared data members << Mendm;
// if (!os)
// error("unable to store CLASS "
// "data on stream");
}
MutuaL CLASS::fget(istream& is, MutuaL InstancE)
{
int newed;
CPTR thiS;
// is >> CLASS-declared data member initializers
// >> Mnextm;
// if (!is) {
// serror("unable to load CLASS "
// "data from stream",
// ID_CLASS);
// return MutuaL0;
// }
if (InstancE) {
newed = 0;
thiS = (CPTR) InstancE;
}
else {
if ((thiS = new CLASS(initVFTsEtc))
== CPTR0) {
serror("unable to construct "
"new CLASS for "
"loading",
ID_CLASS);
return MutuaL0;
}
newed = 1;
InstancE = (MutuaL) thiS;
}
if (!BASE::fget(is,InstancE)) {
if (newed)
delete (voiD) thiS;
return MutuaL0;
}
if (!thiS->initData(/* CLASS-declared data
member initializers */)) {
serror("unable to initialize CLASS "
"from reloaded stream data",
ID_CLASS);
if (newed)
delete (voiD) thiS;
return MutuaL0;
}
return InstancE;
}
CLASS::CLASS (
// CLASS-declared data member initializers
// BASE-declared data member initializers
) : BASE (
// BASE-declared data member initializers
)
{
(void) initData(
// CLASS-declared data member initializers
);
}
CLASS::CLASS(CLASS& c) : BASE(c)
{
// copy initializer constructor
}
int CLASS::operator=(Mutual&)
{
return 0; // disabled
}
MutuaL CLASS::clone()
{
// invokes copy initializer constructor
return (MutuaL) new CLASS(*this);
}
CLASS::~CLASS()
{
// ???
}